﻿@model WebsiteSUPPORTASU.Models.EventUniversityModel
@{
    ViewBag.Title = "AddView";
    Layout = "~/Views/Shared/_Admin.cshtml";
}
<h2>
    AddView</h2>
<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>
<script type="text/javascript">

    function AddTag() {
        textarea.value += document.forms[0].SponsorCheck.value + '\n';
    }

</script>
@using (Html.BeginForm())
{
    @Html.ValidationSummary(true)
    <fieldset>
        <legend>EventTagUniversity</legend>
        @if (@ViewBag.ElementsNames != null)
        {
            <select class="input" name="EventID">
                <option value=""></option>
                @foreach (var Element in @ViewBag.ElementsNames)
                {
                    <option value="@Element.ID">@Element.Name</option>
                }
                @Html.ValidationMessageFor(model => model.EventID)
            </select>
        }
        @if (@ViewBag.Sponsors != null)
        {
            <textarea class="input" type="textarea" name="Sponsors" rows="5" id="textarea"
                readonly="readonly"></textarea>
            <select class="input" name="SponsorCheck">
                <option value=""></option>
                @foreach (var Element in @ViewBag.Sponsors)
                {
                    <option value="@Element.Name">@Element.Name</option>
                }
                @Html.ValidationMessageFor(model => model.Universities)
            </select>
            <input type="button" onclick="AddTag()" value="AddTag" />
        }
        <p>
            <input type="submit" value="Create" />
        </p>
    </fieldset>
}
<div>
    @Html.ActionLink("Back to List", "Index")
</div>
